import Vue from 'vue'
import Router from 'vue-router'
import HomePage from '@/components/HomePage.vue'
import Parallax from '@/components/Parallax.vue'
import BlogList from '@/components/front/blog/BlogList.vue'
import BlogView from '@/components/front/blog/BlogView.vue'
import NewBlog from '@/components/front/blog/NewBlog.vue'

Vue.use(Router);

export default new Router({
    // mode: 'history',
    routes: [
        {
            path: '/',
            redirect: "/parallax"
        },
        {
            path: '/parallax',
            name: 'parallax',
            component: Parallax,
            meta: {title: '首页', noCache: true}
        },
        {
            path: '/newBlog',
            name: 'newBlog',
            component: NewBlog,
            meta: {title: '新增博客', noCache: true}
        },
        {
            path: '/home',
            name: 'home',
            component: HomePage,
            meta: {title: '首页'},
            children: [
                {
                    path: "/",
                    redirect: "/blogList"
                },
                {
                    path: '/blogList',
                    name: 'blogList',
                    component: BlogList,
                    meta: {title: '博客列表'}
                },
                {
                    path: '/blogView',
                    name: 'blogView',
                    component: BlogView,
                    meta: {title: '博客详情'}
                }
            ]
        },
        {
            path: '*',
            redirect: '/404',
            meta: {title: '页面失踪了', noCache: true}
        }]
})
